import request from '@/utils/request'

// 查询模型层次树下拉框列表
export const getModelTreeSelectApi = (id) =>
  request.get('/core/vom/model/design/treeview/combo-items')

// 查询模型层次树顶层节点列表
export const getTreeRootListApi = (treeviewId) =>
  request.get(
    `/core/vom/model/design/treeview/top-node/list?treeviewId=${treeviewId}`
  )

// 查询模型层次树下级节点列表
export const getTreeChildListApi = (parentNodeId) =>
  request.get(
    `/core/vom/model/design/treeview/node/list?parentNodeId=${parentNodeId}`
  )

// 查询模型层次树列表
export const getAddTreeModelListApi = () =>
  request.get('/core/vom/model/design/treeview/list')

// 查询模型层次树基本信息
export const getTreeModelDataApi = (treeviewId) =>
  request.get(`/core/vom/model/design/treeview?treeviewId=${treeviewId}`)

// 创建模型层次树
export const addModleTreeApi = (data) =>
  request.post('/core/vom/model/design/treeview', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 修改模型层次树
export const editModleTreeApi = (data) =>
  request.post('/core/vom/model/design/treeview/put', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 删除模型层次树
export const delModleTreeApi = (treeviewId) =>
  request.post(`/core/vom/model/design/treeview/delete?treeviewId=${treeviewId}`)

// 查询模型层次树可新增类模型列表
export const getAddTreeNodeListApi = (nodeId) =>
  request.get(
    `/core/vom/model/design/treeview/node/to-relation/list?nodeId=${nodeId}`
  )

// 批量创建模型层次树节点
export const addTreeNodeApi = (data) =>
  request.post('/core/vom/model/design/treeview/node', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 查询模型层次树节点基本信息
export const getTreeNodeDataApi = (nodeId) =>
  request.get(`/core/vom/model/design/treeview/node?nodeId=${nodeId}`)

// 修改模型层次树节点名称
export const editTreeNodeApi = (data) =>
  request.post('/core/vom/model/design/treeview/node/put', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 查询节点菜单列表
export const getNodeMenuListApi = (nodeId) =>
  request.get(`/core/vom/model/design/treeview/node/menu/list?nodeId=${nodeId}`)

// 删除模型层次树节点
export const delTreeNodeApi = (nodeId) =>
  request.post(`/core/vom/model/design/treeview/node/delete?nodeId=${nodeId}`)

// 上移模型层次树节点
export const upTreeNodeApi = (nodeId) =>
  request.post(`/core/vom/model/design/treeview/node/move-up?nodeId=${nodeId}`, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 下移模型层次树节点
export const downTreeNodeApi = (nodeId) =>
  request.post(`/core/vom/model/design/treeview/node/move-down?nodeId=${nodeId}`, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 创建节点菜单分组
export const addMenuGroupApi = (data) =>
  request.post('/core/vom/model/design/treeview/node/menu-group?', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 修改节点菜单名称
export const editMenuGroupApi = (data) =>
  request.post('/core/vom/model/design/treeview/node/menu/put?', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 删除节点菜单
export const delMenuNodeApi = (menuId) =>
  request.post(`/core/vom/model/design/treeview/node/menu/delete?menuId=${menuId}`, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 上移模型层次树节点
export const upMenuNodeApi = (menuId) =>
  request.post(`/core/vom/model/design/treeview/node/menu/move-up?menuId=${menuId}`, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 下移模型层次树节点
export const downMenuNodeApi = (menuId) =>
  request.post(`/core/vom/model/design/treeview/node/menu/move-down?menuId=${menuId}`, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 创建节点菜单项
export const addMenuItemApi = (data) =>
  request.post('/core/vom/model/design/treeview/node/menu?', data, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })

// 查询菜单动作下拉列表
export const getMenuActionListApi = () =>
  request.get('/core/dictionary/combo-item/list?dictType=NodeMenuAction')